/*
 * Copyright © 2021 Dowsure
 * https://www.dowsure.com/
 *
 * All rights reserved.
 */
package com.dowsure.apisaas.enums;

/**
 * @description: 时间单位
 * @author: Dowsure
 * @create: 2021-12-08 12:01
 **/
public enum TermUnitEnums {

    DAY("DAY", "日"),
    MONTH("MONTH", "月"),
    YEAR("YEAR", "年");

    private String value;

    private String describe;

    TermUnitEnums(String value, String describe){
        this.value = value;
        this.describe = describe;
    }

    public String getValue() {
        return value;
    }

    @Override
    public String toString() {
        return String.valueOf(value);
    }

    public static TermUnitEnums fromValue(String text) {
        for (TermUnitEnums b : TermUnitEnums.values()) {
            if (String.valueOf(b.value).equals(text)) {
                return b;
            }
        }
        return null;
    }
}
